/* SharePoint Console Project
 * Http://SharePointConsole.codeplex.com
 * Copyright Jean-Alain Baeyens (2009)
 * Software under Microsoft Reciprocal License (Ms-RL)
 */

using System;
using System.Web.UI.WebControls.WebParts;

using Microsoft.SharePoint;
using Microsoft.SharePoint.WebPartPages;

namespace Sharepoint.Console.WebParts
{
    public class SharepointHelper
    {

        public System.Web.UI.WebControls.WebParts.WebPart GetWebPart(SPLimitedWebPartManager wpm, string title)
        {
            foreach (System.Web.UI.WebControls.WebParts.WebPart wp in wpm.WebParts)
            {
                if (wp.Title == title)
                    return wp;
            }
            return null;
        }

    }
}
